package com.bawei.property.entity

import com.bawei.network.BaseResponse
import com.blankj.utilcode.util.GsonUtils
import org.json.JSONArray
import java.io.Serializable

/**
 * 车位列表返回对象
 */
data class ParkListResultEntity(
    val values: String
): BaseResponse(){
    fun getValues(): List<ParkValue> {
        var list = mutableListOf<ParkValue>()
        var data = JSONArray(values)
        for (i in 0 until data.length()){
            list.add(GsonUtils.fromJson(data[i].toString(), ParkValue::class.java))
        }
        return list
    }
}

data class ParkValue(
    var parkUser: Int = 0,
    var parkId: Int = 0,
    var parkTime: String = "",
    var parkName: String = "",
    var parkEnd: String = "",
    var parkStart: String = "",
    var leftFlag: Boolean = false
): Serializable